package com.mall.ibatis.bean;

import java.io.Serializable;

import com.mall.util.StringUtil;
import com.thoughtworks.xstream.XStream;

@SuppressWarnings("serial")
public class Method implements Serializable,ICell{
	private String id;
	//用来作为变量
	private String num;
	//用来取值
	private String num2;
	private String name;
	//用来对应功能的id
	private String funId;

	public Method(){
		
	}
	public Method(String id,String name){
		this.id = id;
		this.name = name;
	}
	
	public String getNum2() {
		return num2;
	}
	public void setNum2(String num2) {
		this.num2 = num2;
	}
	public String getNum() {
		return num;
	}
	public void setNum(String num) {
		this.num = num;
	}
	public String getFunId() {
		return funId;
	}
	public void setFunId(String funId) {
		this.funId = funId;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCellID() {
		return StringUtil.null2Empty(id);
	}

	public String toCell() {
		StringBuffer cellBuffer  = new StringBuffer();
		cellBuffer.append("<id><![CDATA[" + StringUtil.null2Empty(id)+"]]></id>");
		cellBuffer.append("<num><![CDATA[" + StringUtil.null2Empty(num)+"]]></num>");
		cellBuffer.append("<name><![CDATA[" + StringUtil.null2Empty(name)+"]]></name>");
		return cellBuffer.toString();
	}

	public String toXML() {
		XStream xStream = new XStream();
		xStream.alias(this.getClass().getSimpleName(),this.getClass());
		return xStream.toXML(this);
	}
	
	
}
